#pragma once

struct ArgbPixel
{
public: 
	ArgbPixel();
private: 
	ArgbPixel(XUINT32);
public: 
	union
	{
		struct 
		{
			XUINT32 b:8;
			XUINT32 g:8;
			XUINT32 r:8;
			XUINT32 a:8;
		};
		XUINT32 argb;
	};


	static struct ArgbPixel FromUint(XUINT32 uARGB);
	void ApplyAlpha(XUINT32 uAlpha);
	void AssertPremultiplied();
	XBOOL IsFullyOpaque();
	XBOOL IsFullyTransparent();
	XBOOL HasLinearAlpha();
	bool operator==(struct ArgbPixel & r);
	bool operator!=(struct ArgbPixel & r);
	void SetZero();
	void SetArgb(struct ArgbPixel color);
	unsigned int GetGrayArgb();
	struct ArgbPixel ApplyAlphaCore(XUINT32 alpha);
	struct ArgbPixel BlendPaintGrayAlpha(struct ArgbPixel argbPaint, XUINT32 uAlpha);
	struct ArgbPixel BlendPaint(struct ArgbPixel paint);
};